﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="~/DynamicData/PageTemplates/Insert.aspx.cs" Inherits="SRS.Insert" %>
     
<asp:Content ID="headContent" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class=SRS_PageLayout>
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true">
        <DataControls>
            <asp:DataControlReference ControlID="FormView1" />
        </DataControls>
    </asp:DynamicDataManager>
          
    <%
    String TableDisplayName;
    TableDisplayName = table.DisplayName.ToString();
    
    if (TableDisplayName.Equals("Requests"))%>
        <h2 class="SRSSubHeader">Create a New Service Request</h2>
        <%
    if (TableDisplayName.Equals("Users"))%> 
        <h2 class="SRSSubHeader">Add a New User</h2>                   
	    <%
    if (TableDisplayName.Equals("Assignees"))%> 
        <h2 class="SRSSubHeader">Add a New Assignee</h2>
        <% 
    if (TableDisplayName.Equals("Organizations"))%> 
        <h2 class="SRSSubHeader">Add a New Organization</h2>
        <%
    if (TableDisplayName.Equals("Status"))%> 
        <h2 class="SRSSubHeader">Add a New Status</h2>
    <%;%>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
                HeaderText="Please correct the following:" Cssclass="SRSValidator" />
            <asp:DynamicValidator runat="server" ID="DetailsViewValidator" ControlToValidate="FormView1" Display="None" Cssclass="SRSValidator" />
            <asp:FormView runat="server" ID="FormView1" DataSourceID="DetailsDataSource" DefaultMode="Insert"
                OnItemCommand="FormView1_ItemCommand" OnItemInserted="FormView1_ItemInserted" RenderOuterTable="false">
                <InsertItemTemplate>
                    <table id="detailsTable" class="SRSDetailsTable" cellpadding="6">
                        <asp:DynamicEntity runat="server" Mode="Insert" />
                        <tr class="td" align="right">
                            <td colspan="2">
                                &nbsp;&nbsp;
                                <img id="Img1" runat="server" src="~/Images/18x18/save.png" alt="Insert" />
                                <asp:LinkButton runat="server" CommandName="Insert" Text="Save" />&nbsp;&nbsp;
                                <img id="Img2" runat="server" src="~/Images/18x18/cancel.png" alt="Cancel" />
                                <asp:LinkButton runat="server" CommandName="Cancel" Text="Cancel" CausesValidation="false" />
                            </td>
                        </tr>
                    </table>
                </InsertItemTemplate>
            </asp:FormView>
            <asp:EntityDataSource ID="DetailsDataSource" runat="server" EnableInsert="true" />
        </ContentTemplate>
    </asp:UpdatePanel>
    </div>
</asp:Content>

